<?php
$this->headTitle($this->translate('Manage family'));
$this->headScript()
    ->appendScript("
    $(function(){
    //
    $('#person tbody tr').mouseover(function(){
        $(this).addClass('hover').siblings().removeClass('hover');
    });
    $('#person tbody').mouseout(function(){
        $(this).find('tr.hover').removeClass('hover');
    });
});
    ");
//style
$this->headStyle('
body{font-size:12px;}
.wrap{padding-bottom:24px;}
.family{background-color: #554F51;border: 1px solid #222721;font-size:14px;font-family:"宋体";}
.family th,.family td{background-color:#FFFFFF;}
.family thead th{padding:8px 0px;text-align:left;text-indent:200px;font-size:14px;font-weight:normal;height:24px;}
.family thead td{padding:6px 8px;}
.family tbody th{color:#1C1B20;padding:7px 24px;}
.family tbody td{color:#3B403C;padding:7px 8px;}
.family tbody th.bigth{
}

.c-panel{
    width:600px;
    margin-bottom:20px;
    display:none;
}
.panel-head{
    font-size:20px;
    font-weight:bold;
    text-align:center;
    margin-bottom: 3px;
}
.panel-foot{
    text-align:right;
}
.panel-foot p{
    margin:5px auto;
}


#person{width:100%;background-color: #D7E8F5;border: 1px solid #8FC5F1;}
#person th,#person td{background-color:#FFFFFF;}
#person thead td{padding:16px 4px;}
#person tbody td{padding:6px 8px;1px solid #CED2D0;}
#person tbody tr.hover{cursor:hand;}
#person tbody tr.hover td{background-color:#F3F7F8;}
');
?>


<h2>
	<a href="<?php echo $this->url(array(
		'action'=> 'floor'))?>"><?php echo $this->translate('Back to family floor')?></a>
	<span><?php echo $this->translate('Family manage')?></span>
</h2>

<div class="wrap">
<table id="person" class="family" cellpadding="3" cellspacing="1">
<thead>
    <tr>
        <th colspan="25">
        <?php echo $this->family->village?>
        <?php echo $this->family->group?>，
        户编码：<em><?php echo $this->family->fid?></em>
        </th>
    </tr>
    <tr>
        <td>姓名</td>
        <td>性别</td>
        <td>与户主关系</td>
        <td>民族</td>
        <td>出生日期</td>
        <td>婚姻状况</td>
        <td>文化程度</td>
        <td>户口性质</td>
        <td>政策类型</td>
        <td>管理类型</td>
        <td>结婚日期</td>
    </tr>
</thead>
<tbody>
<?php foreach ($this->entries as $people): ?>
    <tr onClick="$('#people-<?php echo $people->pid?>').slideDown().siblings('.c-panel').slideUp();">
        <td><?php echo $people->name?></td>
        <td><?php echo $people->gender?></td>
        <td><?php echo $people->relationship?></td>
        <td><?php echo $people->national?></td>
        <td><?php echo $people->birth_date?></td>
        <td><?php echo $people->marital_status?></td>
        <td><?php echo $people->education?></td>
        <td><?php echo $people->account_nature?></td>
        <td><?php echo $people->policy_type?></td>
        <td><?php echo $people->management_type?></td>
        <td><?php echo $people->marriage_date?></td>
	</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
    <td colspan="25"></td>
</tr>
</tfoot>
</table>
</div>


<?php foreach ($this->entries as $people): ?>
<div class="c-panel" id="people-<?php echo $people->pid?>">
<div class="panel-head">常住人口登记卡</div>
<div class="panel-body">
<table class="family" border="0" cellpadding="3" cellspacing="1" width="600">
	<colgroup>
		<col width="110" />
		<col width="220" />
		<col width="110" />
		<col width="160" />
	</colgroup>
	<tbody>
		<tr>
			<th class="bigth">
				姓&nbsp;&nbsp;&nbsp;&nbsp;名</th>
			<td>
				<?php echo $people->name?></td>
			<th>
				户主或与<br />户主关系</th>
			<td>
				<?php echo $people->relationship?></td>
		</tr>
		<tr>
			<th>
				户口性质</th>
			<td>
				<?php echo $people->account_nature?></td>
			<th>
				性&nbsp;&nbsp;&nbsp;&nbsp;别</th>
			<td>
				<?php echo $people->gender?></td>
		</tr>
		<tr>
			<th>
				户口状况</th>
			<td>
				<?php echo $people->account_status?></td>
			<th>
				民&nbsp;&nbsp;&nbsp;&nbsp;族</th>
			<td>
				<?php echo $people->national?></td>
		</tr>
		<tr>
			<th>
				政策类型</th>
			<td>
				<?php echo $people->policy_type?></td>
			<th>
				出生日期</th>
			<td>
				<?php echo $people->birth_date?></td>
		</tr>
		<tr>
			<th>
				统计类型</th>
			<td>
				<?php echo $people->statistics_type?></td>
			<th>
				婚姻状况</th>
			<td>
				<?php echo $people->marital_status?></td>
		</tr>
		<tr>
			<th>
				管理类型</th>
			<td>
				<?php echo $people->management_type?></td>
			<th>
				避孕措施</th>
			<td>
				<?php echo $people->measure?></td>
		</tr>
		<tr>
			<td>
				　</td>
			<td>
				　</td>
			<td>
				　</td>
			<td>
				　</td>
		</tr>
		<tr>
			<th>
				身&nbsp;份&nbsp;证</th>
			<td colspan="3">
				<?php echo $people->id_number?></td>
		</tr>
		<tr>
			<th>
				文化程度</th>
			<td>
				<?php echo $people->education?></td>
			<th>
				结婚日期</th>
			<td>
				<?php echo $people->marriage_date?></td>
		</tr>
		<tr>
			<th>
				工作单位</th>
			<td>
				<?php echo $people->work_units?></td>
			<th>
				初婚日期</th>
			<td>
				<?php echo $people->marriage_first?></td>
		</tr>
		<tr>
			<th>
				职&nbsp;&nbsp;&nbsp;&nbsp;业</th>
			<td colspan="3">
				<?php echo $people->work?></td>
		</tr>
		<tr>
			<th>
				户&nbsp;籍&nbsp;地</th>
			<td colspan="3">
				<?php echo $people->account_place?></td>
		</tr>
		<tr>
			<th>
				现居住地</th>
			<td colspan="3">
				<?php echo $people->living_place?></td>
		</tr>
	</tbody>
</table>
</div>
<div class="panel-foot">
    <p>
        建档日期：
            <?php echo $people->archiving_created?>
        建档原因：
            <?php echo $people->archiving_reason?>
        <a href="<?php echo $this->url(array(
            'controller'=> 'person',
            'action'=> 'modify',
            'pid'=> $people->pid))?>">编辑</a>
    </p>
</div>
</div>
<?php endforeach;?>


<p>
	<button onclick="location.href='<?php echo $this->url(array(
        'controller'=> 'person',
		'action'=> 'create',
		))?>'"><?php echo $this->translate('Create person')?></button>
	<button onclick="location.href='<?php echo $this->url(array(
		'action'=> 'floor'))?>'"><?php echo $this->translate('Back to family floor')?></button>
</p>